package com.lx.demo.b.core.config;

import com.alibaba.dubbo.config.spring.ReferenceBean;
import com.lx.demo.b.core.constant.Commonsts;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;

/**
 * Created by lanyxp on 2021/2/23 10:35
 * 推荐使用 com.alibaba.dubbo.config.annotation.Reference注解
 * Apache Dubbo 不推荐使用 ReferenceBean<T> 进行消费初始化服务引用
 * {@link com.alibaba.dubbo.config.annotation.Reference}
 */
@Deprecated
@Configuration
@Slf4j
public class DubboConfig {
    private <T> ReferenceBean createReferenceBean(Class<T> interfanceclass) {
        ReferenceBean referenceBean = new ReferenceBean();
        referenceBean.setInterface(interfanceclass);
        referenceBean.setCheck(Boolean.FALSE);
        referenceBean.setOwner(Commonsts.DUBO_OWNER);
        referenceBean.setTimeout(Commonsts.DUBO_TIME);
        referenceBean.setGroup(Commonsts.DUBO_GROUP);
        referenceBean.setVersion(Commonsts.DUBO_VERSION);
        return referenceBean;
    }
    //dubbo服务引用
}
